import {get,post} from "./http";

//1:与用户相关
//拿到所有用户信息
export const getallusers = () => get(`/user/getalls`);
//添加用户
export const register = (params) => post(`/register`,params)
//根据用户id删除用户
export const deleteuser = (id) => get(`/deleteById?id=${id}`);
//根据分页拿到用户信息
export const getalluser = (currentPage) => get(`/user/getall?currentPage=${currentPage}`);
//搜索用户
export const search = (currentPage,search) => get(`/search?currentPage=${currentPage}&search=${search}`);

//与游戏相关
//获取所有游戏信息
export const getallgame = () => post('/game/getGameAll');
//根据分页获取全部游戏
export const getallgames = (currentPage) => get(`/game/Pageall?currentPage=${currentPage}`);
//搜索游戏
export const gamesearch = (currentPage,search) => get(`/game/search?currentPage=${currentPage}&search=${search}`);
//添加游戏
export const addgame = (params) => post(`/game/addgame`,params)
//根据用户id删除用户
export const deletegame = (id) => get(`/game/deleteById?id=${id}`);

//与订单相关
//获取所有订单信息
export const getallorder = () => get('/rechargerecord/getallorder');
//根据分页获取全部订单信息
export const getallorders = (currentPage) => get(`/rechargerecord/allorder?currentPage=${currentPage}`);
//根据id搜索订单信息
export const ordersearch = (currentPage,search) => get(`/rechargerecord/search?currentPage=${currentPage}&search=${search}`);
